package indzcraft.loader;

import java.util.ArrayList;
import java.util.List;

public class Gem{
	
	public static final int META = 6;
	public static final int RED = 0;
	public static final int ORANGE = 5;
	public static final int PURPLE = 3;
	public static final int BLUE = 1;
	public static final int GREEN = 4;
	public static final int YELLOW = 2;
	public static final int HYDRAULIC = 9;
	public static final int COGWHEEL = 10;
	
	private int type = 0; // 1 = meta, 2 = red, 4 = orange, 8 = purple
	private int str = 0;
	private int agi = 0;
	private int sta = 0;
	private int hit = 0;
	private int crit = 0;
	private int exp = 0;
	private int haste = 0;
	private int mastery = 0;
	private int id;
	private String name;
	private String icon;
	private int reqSkill;
	private int quality;
	private double ep;
	private String gearBuff;
	
	public static String[] SocketColors = { 
		"NONE", // 0
		"META", // 1
		"RED",	// 2
		"NONE", 
		"YELLOW",	// 4
		"NONE", 
		"NONE", 
		"NONE", 
		"BLUE",	// 8
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"PRISMATIC",	// 14
		"NONE",
		"HYDRAULIC",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"NONE",
		"COGWHEEL", // 32
	};
	
	public static int[] Colors = { 
		Gem.RED, Gem.BLUE, Gem.YELLOW, Gem.PURPLE, Gem.GREEN, Gem.ORANGE, Gem.META, 0, 0, Gem.HYDRAULIC, Gem.COGWHEEL
	};
	
	
	public Gem(){
		//
	}
	
	public Gem(int id, String name,String icon,int type,int a,int h,int ha,int ma){
		this.setId(id);
		this.setName(name);
		this.setIcon(icon);
		this.type = type;
		agi = a;
		hit = h;
		haste = ha;
		mastery = ma;
	}
	
	public int getType(){
		return type;
	}
	
	public void setAgi(int a){
		agi = a;
	}
	public void setHit(int a){
		hit = a;
	}
	public void setHaste(int a){
		haste = a;
	}
	
	public int getAgi(){
		return agi;
	}
	public int getHit(){
		return hit;
	}
	public int getHaste(){
		return haste;
	}
	
	public String toString(){
		List<String> elems = new ArrayList<String>();
		if(this.agi != 0){
			elems.add(this.agi + " Agility");
		}
		if(this.str != 0){
			elems.add(this.str + " Strength");
		}
		if(this.exp != 0){
			elems.add(this.exp + " Expertise");
		}
		if(this.haste != 0){
			elems.add(this.haste + " Haste");
		}
		if(this.mastery != 0){
			elems.add(this.mastery + " Mastery");
		}
		if(this.crit != 0){
			elems.add(this.crit + " Crit");
		}
		if(this.hit != 0){
			elems.add(this.hit + " Hit");
		}
		if(this.sta != 0){
			elems.add(this.sta + " Stamina");
		}
		StringBuilder sb = new StringBuilder();
		for(String elem : elems){
			sb.append(elem);
			if(!elems.get(elems.size()-1).equals(elem))
				sb.append(" / ");
		}
		return sb.toString();
	}

	public String getName() {
		return this.name;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getIcon() {
		return icon;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setMastery(int mastery) {
		this.mastery = mastery;
	}

	public int getMastery() {
		return mastery;
	}

	public void setStr(int str) {
		this.str = str;
	}

	public int getStr() {
		return str;
	}

	public void setSta(int sta) {
		this.sta = sta;
	}

	public int getSta() {
		return sta;
	}

	public void setCrit(int crit) {
		this.crit = crit;
	}

	public int getCrit() {
		return crit;
	}

	public void setExp(int exp) {
		this.exp = exp;
	}

	public int getExp() {
		return exp;
	}

	public void setType(int int1) {
		this.type = int1;
	}

	public void setReqSkill(int reqSkill) {
		this.reqSkill = reqSkill;
	}

	public int getReqSkill() {
		return reqSkill;
	}
	
	public void setQuality(int quality) {
		this.quality = quality;
	}
	public int getQuality() {
		return quality;
	}

	public void setEP(double ep) {
		this.ep = ep;
	}

	public double getEP() {
		return ep;
	}

	public String getGearBuff() {
		return gearBuff;
	}

	public void setGearBuff(String gearBuff) {
		this.gearBuff = gearBuff;
	}
}
